/*
 * File Name: StartServiceReceiver.java 
 * History:
 * Created by zhangzhiyong on 2013-9-26
 */
package com.denny.devdemo.clearer.worker;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

import com.denny.devdemo.util.LogUtils;

public class StartServiceReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        LogUtils.e("action:"+action);
        if (Intent.ACTION_BOOT_COMPLETED.equals(action) 
                || Intent.ACTION_SCREEN_OFF.equals(action)
                || ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
            Intent intent1 = new Intent(context,ScanService.class);
            context.startService(intent1);
        }
    }

}
